#coding=utf8
import arcpy
import json
arcpy.env.overwriteOutput = True
spRef = arcpy.SpatialReference(4490)

jsonFile = r'D:\WorkData\20250724JH\geoserver\2.json'
with open(jsonFile.decode('utf-8'), 'rb') as file:
    content = file.read().decode('utf-8')
data = json.loads(content)
point_list = []
for i in range(len(data['features'])):
    coord_x = data['features'][i]['geometry']['coordinates'][0]
    coord_y = data['features'][i]['geometry']['coordinates'][1]
    pid = data['features'][i]['properties']['id']
    name = data['features'][i]['properties']['name']
    cn = [coord_x, coord_y, pid, name]
    point_list.append(cn)
m_point = arcpy.CreateFeatureclass_management(r'D:\WorkData\20250724JH\geoserver', 'res.shp', 'POINT',spatial_reference=spRef)
arcpy.AddField_management(m_point, 'pid', 'TEXT')
arcpy.AddField_management(m_point, 'name', 'TEXT')
cs = arcpy.da.InsertCursor(m_point, ['SHAPE@X', 'SHAPE@Y','pid','name'])
for point in point_list:
    cs.insertRow(point)
del cs